package com.example.drools.spring.yc.entity.model;

import com.example.drools.spring.entity.DroolModel;
import com.example.drools.spring.entity.DroolRule;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import lombok.Getter;
import lombok.Setter;

/**
 * @author ddsyw
 * @version 1.0
 * @date 2021/12/31 10:24 上午
 */
@Getter
@Setter
public class YcCheckNullModel extends DroolModel implements Serializable {
  private static final long serialVersionUID = 7522346278593896586L;

  private static final String PATH_NAME = "src/main/resources/drl/yc/checknull.drl";

  private static final String PACKAGE_NAME = "com.drools.yc.checknull";

  private static final List<String> IMPORT_CLASS = Arrays.asList("java.util.Map","com.example.drools.spring.entity.CheckResult");

  private static final String RULE_NAME = "checkNullValue";

  public static YcCheckNullModel initBaseParam() {
    YcCheckNullModel ycCheckNullModel = new YcCheckNullModel();
    ycCheckNullModel.setPathName(PATH_NAME);
    ycCheckNullModel.setPackageName(PACKAGE_NAME);
    ycCheckNullModel.setImportClass(IMPORT_CLASS);
    DroolRule droolRule = new DroolRule();
    droolRule.setRule(RULE_NAME);
    ycCheckNullModel.setDroolRules(Arrays.asList(droolRule));
    return ycCheckNullModel;
  }

}
